package org.dromara.system.domain.bo;

import cn.idev.excel.annotation.ExcelProperty;
import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.system.domain.SimMallCommodity;

import java.math.BigDecimal;

/**
 * 商城商品业务对象 sim_mall_commodity
 *
 * @author Lion Li
 * @date 2025-08-15
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = SimMallCommodity.class, reverseConvertGenerate = false)
public class SimMallCommodityBo extends BaseEntity {

    /**
     *
     */
    private Long id;

    /**
     *
     */
    private Long userId;

    @NotNull(message = "商城名称不能为空", groups = {AddGroup.class, EditGroup.class})
    private Long mallNameId;


    @NotNull(message = "分类不能为空", groups = {AddGroup.class, EditGroup.class})
    private Long mallClassificationId;


    @NotBlank(message = "商品名称不能为空", groups = {AddGroup.class, EditGroup.class})
    private String commodityTitle;

    /**
     * 商品logo
     */
    @NotBlank(message = "商品logo不能为空", groups = {AddGroup.class, EditGroup.class})
    private String commodityLogo;

    /**
     * 商品图片 以 | 做分割符号
     */
    @NotBlank(message = "商品图片 以 | 做分割符号不能为空", groups = {AddGroup.class, EditGroup.class})
    private String commodityImages;

    /**
     * 折扣价
     */
    @NotNull(message = "价格不能为空", groups = {AddGroup.class, EditGroup.class})
    private BigDecimal commodityPrice;

    /**
     * 商品描述
     */
    @NotBlank(message = "商品描述不能为空", groups = {AddGroup.class, EditGroup.class})
    private String commodityDescription;

    /**
     * 库存
     */
    @NotNull(message = "库存不能为空", groups = {AddGroup.class, EditGroup.class})
    private Integer commodityStock;

    /**
     * 排序
     */
    @NotNull(message = "排序不能为空", groups = {AddGroup.class, EditGroup.class})
    private Integer commoditySort;

    /**
     * 状态(0:禁用,1:启用)
     */
    @NotNull(message = "状态不能为空", groups = {AddGroup.class, EditGroup.class})
    private Integer commodityStatus;


    //是否参与升级
    private Integer isAllowUpgrade;


    /**
     * 备注
     */
    private String remark;


    @ExcelProperty(value = "商城名称")
    private String mallName;

    @ExcelProperty(value = "商城分类名称")
    private String classificationName;


}
